var vm = new Vue({
        el: '#app',
        data: {
            host: HOST,
            user_id: '',
            username: '',
            datatime: '',
            publishs: ''
        },
        mounted: function () {
            CKEDITOR.replace('editor2');
            this.user_id = '1';
            this.username = 'andajnda';
        },
        methods: {
            data_time: function () {
                var date = new Date();
                var seperator1 = "-";
                var year = date.getFullYear();
                var month = date.getMonth() + 1;
                var strDate = date.getDate();
                if (month >= 1 && month <= 9) {
                    month = "0" + month;
                }
                if (strDate >= 0 && strDate <= 9) {
                    strDate = "0" + strDate;
                }
                this.datatime = year + seperator1 + month + seperator1 + strDate;
            },
            click_subment: function () {
                this.data_time();
                this.publishs = CKEDITOR.instances.editor2.getData();
                axios.post(this.host + '/publish_tsukkomi_view/', {
                    user_id: this.user_id,
                    username: this.username,
                    datatime: this.datatime,
                    publishs: this.publishs
                })
                    .then(response => {
                        console.log(this.text)
                        this.text = response.data
                        console.log(response)
                    })
                    .catch(error => {
                        console.log(this.text)
                    })

            }
        }

    })
;